# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.contrib import admin
from blog import models
from markdownx.admin import MarkdownxModelAdmin
from blog.models import User, VisitCount, Images, BaseInfo, Category, Tag, Source
from blog.models import Article, Comment, Links, Guid, Plugins

class VisitCountAdmin(admin.ModelAdmin):
    def name(self, obj):
        return (obj.date_count)
    name.short_description = "名字"

    list_display = ('date_count', 'page_view', 'unique_vistor', 'name')
    list_display_links = ('name',)
    list_editable = ('date_count',)
    list_filter = ('date_count',)
    search_fields = ('date_count',)
    #fields = ('date_count', 'unique_vistor',)
    #exclude = ('page_view',)
    fieldsets = (
        (None, {'fields': ('date_count', )}),
        #('高级设置', {'fields': ('page_view', 'unique_vistor'), 'classes': ('wide', 'extrapretty')})
        ('高级设置', {'fields': ('page_view', 'unique_vistor'), 'classes': ('collapse',)})
    )



admin.site.register(User)
admin.site.register(VisitCount, VisitCountAdmin)
admin.site.register(Images)
admin.site.register(BaseInfo)
admin.site.register(Category)
admin.site.register(Tag)
admin.site.register(Source)
admin.site.register(Article, MarkdownxModelAdmin)
admin.site.register(Comment)
admin.site.register(Links)
admin.site.register(Guid)
admin.site.register(Plugins)
